package com.updesignsz.admin.service;

import com.updesignsz.admin.mapper.NewsMapper;
import com.updesignsz.commom.entity.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 新闻
 * Creation date 2020-8-8 14:56:13
 */
@Service
public class NewsService {

	@Autowired
	private NewsMapper newsMapper;

	public void deleteNews(Integer id) {
		newsMapper.deleteNews(id);
	}

	public List<News> listAll(News type) {
		return newsMapper.listAll(type);
	}

	public void saveNews(News form) {
		newsMapper.saveNews(form);
	}

	public void updateNews(News form) {
		newsMapper.updateNews(form);
	}

	public News getById(Integer id) {
		return newsMapper.getById(id);
	}

}